package com.immediatus.graphics.texture.region;

import com.immediatus.graphics.contracts.ITexture;

public class TextureRegion extends BaseTextureRegion{

    public TextureRegion(final ITexture texture_, final int x_, final int y_, final int w_, final int h_){
        super(texture_, x_, y_, w_, h_);
    }

    @Override
    public TextureRegion deepCopy(){
        return new TextureRegion(this.getTexture(), this.getX(), this.getY(), this.getWidth(), this.getHeight());
    }

    @Override
    public float getTextureCoordinateX1(){
        return (float) this.getX() / this.getTexture().getWidth();
    }

    @Override
    public float getTextureCoordinateY1(){
        return (float) this.getY() / this.getTexture().getHeight();
    }

    @Override
    public float getTextureCoordinateX2(){
        return (float) (this.getX() + this.getWidth()) / this.getTexture().getWidth();
    }

    @Override
    public float getTextureCoordinateY2(){
        return (float) (this.getY() + this.getHeight()) / this.getTexture().getHeight();
    }
}
